<template>
	<div style="padding: 15px 10px 60px">
         <div class="cell">
         	<div>单价:</div>
         	<div>{{format(data.comPrice)}}</div>
         </div>
         <div class="cell">
         	<div>佣金:</div>
         	<div>{{format(data.money)}}</div>
         </div>
         <div class="cell">
         	<div>数量:</div>
         	<div>{{formatCount(data.goodsCount)}}</div>
         </div>
         <div class="cell">
         	<div>限购:</div>
         	<div>{{formatLimit(data.limitCount)}}</div>
         </div>   
         <div class="cell" v-if="data.goodsCount>0">
         	<div style="font-size: 16px;color: #333;">总价:</div>
         	<div style="color: #F22613;font-size: 16px;font-weight: bold;">{{all(data.comPrice,data.goodsCount)}}</div>
         </div>          
	</div>	
</template>

<script>
export default {	
	data() {
       return {
          
       }
	},
    props:['data'],	
	methods: {	
	  formatLimit(str){
		if(str==-1){
			return '不限购'
		}else{
			return str
		}	  	
	  },
	  formatCount(str){
		if(str==-1){
			return '不限量'
		}else{
			return str
		}	  	
	  },
      format(str){
      	str=Number(str).toFixed(2)
      	return str
      },
      all(num1,num2){
      	return (Number(num1)*Number(num2)).toFixed(2)
      }
	},
	mounted() {
		
	}
}	
</script>

<style scoped="">
.cell{display: flex;justify-content: space-between;font-size: 14px;color: #999;margin-bottom: 10px;}
</style>